/**
* 分页组件
*/
<template>
  <el-pagination
    class="pageclass"
    :current-page="params.pageindex"
    :page-sizes="[10, 20, 30, 40]"
    :page-size="params.pagesize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>
<script>
export default {
  name: 'Pagination',
  props: ['params', 'total'],
  data() {
    return {
      pageparm: {
        pageindex: this.params.pageindex,
        pagesize: this.params.pagesize
      }
    }
  },
  created() {},
  methods: {
    handleSizeChange(val) {
      this.pageparm.pagesize = val
      this.$emit('callPagin', this.pageparm)
    },
    handleCurrentChange(val) {
      this.pageparm.pageindex = val
      this.$emit('callPagin', this.pageparm)
    }
  }
}
</script>

<style>
.pageclass {
  float: right;
  margin-top: 20px;
}
</style>
